//
//  UpdateUserProfileViewModel.swift
//  ExtremeHealth
//
//  Created by Zhongkai Li 李忠凯 on 2018/9/21.
//  Copyright © 2018 GanDongKeJi. All rights reserved.
//

import RxSwift
import Toast

struct UpdateUserProfileViewModel {
    func update(gender: Int,
                birthday: String,
                weight: String,
                height: String,
                avatarUrl: String,
                description: String,
                targetCalory: Int,
                bag: DisposeBag) {
        Network.request(target:
            .updateProfile(gender: gender,
                            birthday: birthday,
                            weight: weight,
                            height: height,
                            avatarUrl: avatarUrl,
                            description: description,
                            targetCalory: targetCalory),
                        success: { (json: LoginModel) in
                            print(json)
        }, failure: { (moyaError) in
            EHToast.show(moyaError.localizedDescription)
        }, error: { (errorStr) in
            EHToast.show(errorStr)
        }, dispose: bag)
    }
}
